import { Component, inject } from '@angular/core';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzImage, NzImageModule, NzImageService } from 'ng-zorro-antd/image';

@Component({
  selector: 'app-image-service',
  standalone: true,
  imports: [NzImageModule, NzButtonModule],
  template: `
    <p class="demo">
      <button nz-button (click)="preview()">Preview</button>
    </p>
  `,
  styles: ``,
})
export class ImageServiceComponent {
  imageService = inject(NzImageService);

  preview() {
    const images: NzImage[] = [
      { src: '/image1.png' },
      { src: '/ng-zorro-antd.svg' },
    ];
    this.imageService.preview(images, { nzZoom: 1.5 });
  }
}
